import './interfaces';
import update from './atom/db/update';

async function atom(msg: Message, headers: IHeaders) {
	const systemid = '@systemid';
	const { exec, prepare } = update(headers.actionid, headers.sessionid, headers.spaceid, systemid);

	prepare('@tablename1', msg.tb1);
	prepare('@tablename2', msg.tb2);
	const ret = await exec();
	if (ret.code === 1) {
		return 'success';
	} else {
		return 'fail';
	}
}
